\(\int \cot (x) \sqrt {a+b \cot ^4(x)} \, dx\) [60]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [B] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 15, antiderivative size = 90 \[ \int \cot (x) \sqrt {a+b \cot ^4(x)} \, dx=\frac {1}{2} \sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \cot ^2(x)}{\sqrt {a+b \cot ^4(x)}}\right )+\frac {1}{2} \sqrt {a+b} \text {arctanh}\left (\frac {a-b \cot ^2(x)}{\sqrt {a+b} \sqrt {a+b \cot ^4(x)}}\right )-\frac {1}{2} \sqrt {a+b \cot ^4(x)} \]

[Out]

1/2*arctanh(cot(x)^2*b^(1/2)/(a+b*cot(x)^4)^(1/2))*b^(1/2)+1/2*arctanh((a-b*cot(x)^2)/(a+b)^(1/2)/(a+b*cot(x)^
4)^(1/2))*(a+b)^(1/2)-1/2*(a+b*cot(x)^4)^(1/2)

Rubi [A] (verified)

Time = 0.17 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.467, Rules used = {3751, 1262, 749, 858, 223, 212, 739} \[ \int \cot (x) \sqrt {a+b \cot ^4(x)} \, dx=\frac {1}{2} \sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \cot ^2(x)}{\sqrt {a+b \cot ^4(x)}}\right )+\frac {1}{2} \sqrt {a+b} \text {arctanh}\left (\frac {a-b \cot ^2(x)}{\sqrt {a+b} \sqrt {a+b \cot ^4(x)}}\right )-\frac {1}{2} \sqrt {a+b \cot ^4(x)} \]

[In]

Int[Cot[x]*Sqrt[a + b*Cot[x]^4],x]

[Out]

(Sqrt[b]*ArcTanh[(Sqrt[b]*Cot[x]^2)/Sqrt[a + b*Cot[x]^4]])/2 + (Sqrt[a + b]*ArcTanh[(a - b*Cot[x]^2)/(Sqrt[a +
 b]*Sqrt[a + b*Cot[x]^4])])/2 - Sqrt[a + b*Cot[x]^4]/2

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 739

Int[1/(((d_) + (e_.)*(x_))*Sqrt[(a_) + (c_.)*(x_)^2]), x_Symbol] :> -Subst[Int[1/(c*d^2 + a*e^2 - x^2), x], x,
 (a*e - c*d*x)/Sqrt[a + c*x^2]] /; FreeQ[{a, c, d, e}, x]

Rule 749

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(d + e*x)^(m + 1)*((a + c*x^2)^p/(e
*(m + 2*p + 1))), x] + Dist[2*(p/(e*(m + 2*p + 1))), Int[(d + e*x)^m*Simp[a*e - c*d*x, x]*(a + c*x^2)^(p - 1),
 x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && GtQ[p, 0] && NeQ[m + 2*p + 1, 0] && ( !Ration
alQ[m] || LtQ[m, 1]) &&  !ILtQ[m + 2*p, 0] && IntQuadraticQ[a, 0, c, d, e, m, p, x]

Rule 858

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dist[g/e, Int[(d
+ e*x)^(m + 1)*(a + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + c*x^2)^p, x], x] /; FreeQ[{a,
c, d, e, f, g, m, p}, x] && NeQ[c*d^2 + a*e^2, 0] &&  !IGtQ[m, 0]

Rule 1262

Int[(x_)*((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Dist[1/2, Subst[Int[(d + e*x)^q
*(a + c*x^2)^p, x], x, x^2], x] /; FreeQ[{a, c, d, e, p, q}, x]

Rule 3751

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff/f), Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2
 + ff^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {x \sqrt {a+b x^4}}{1+x^2} \, dx,x,\cot (x)\right ) \\ & = -\left (\frac {1}{2} \text {Subst}\left (\int \frac {\sqrt {a+b x^2}}{1+x} \, dx,x,\cot ^2(x)\right )\right ) \\ & = -\frac {1}{2} \sqrt {a+b \cot ^4(x)}-\frac {1}{2} \text {Subst}\left (\int \frac {a-b x}{(1+x) \sqrt {a+b x^2}} \, dx,x,\cot ^2(x)\right ) \\ & = -\frac {1}{2} \sqrt {a+b \cot ^4(x)}+\frac {1}{2} b \text {Subst}\left (\int \frac {1}{\sqrt {a+b x^2}} \, dx,x,\cot ^2(x)\right )-\frac {1}{2} (a+b) \text {Subst}\left (\int \frac {1}{(1+x) \sqrt {a+b x^2}} \, dx,x,\cot ^2(x)\right ) \\ & = -\frac {1}{2} \sqrt {a+b \cot ^4(x)}-\frac {1}{2} (-a-b) \text {Subst}\left (\int \frac {1}{a+b-x^2} \, dx,x,\frac {a-b \cot ^2(x)}{\sqrt {a+b \cot ^4(x)}}\right )+\frac {1}{2} b \text {Subst}\left (\int \frac {1}{1-b x^2} \, dx,x,\frac {\cot ^2(x)}{\sqrt {a+b \cot ^4(x)}}\right ) \\ & = \frac {1}{2} \sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \cot ^2(x)}{\sqrt {a+b \cot ^4(x)}}\right )+\frac {1}{2} \sqrt {a+b} \text {arctanh}\left (\frac {a-b \cot ^2(x)}{\sqrt {a+b} \sqrt {a+b \cot ^4(x)}}\right )-\frac {1}{2} \sqrt {a+b \cot ^4(x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.19 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.96 \[ \int \cot (x) \sqrt {a+b \cot ^4(x)} \, dx=\frac {1}{2} \left (\sqrt {b} \text {arctanh}\left (\frac {\sqrt {b} \cot ^2(x)}{\sqrt {a+b \cot ^4(x)}}\right )+\sqrt {a+b} \text {arctanh}\left (\frac {a-b \cot ^2(x)}{\sqrt {a+b} \sqrt {a+b \cot ^4(x)}}\right )-\sqrt {a+b \cot ^4(x)}\right ) \]

[In]

Integrate[Cot[x]*Sqrt[a + b*Cot[x]^4],x]

[Out]

(Sqrt[b]*ArcTanh[(Sqrt[b]*Cot[x]^2)/Sqrt[a + b*Cot[x]^4]] + Sqrt[a + b]*ArcTanh[(a - b*Cot[x]^2)/(Sqrt[a + b]*
Sqrt[a + b*Cot[x]^4])] - Sqrt[a + b*Cot[x]^4])/2

Maple [A] (verified)

Time = 0.24 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.54

method result size
derivativedivides \(-\frac {\sqrt {b \left (\cot \left (x \right )^{2}+1\right )^{2}-2 b \left (\cot \left (x \right )^{2}+1\right )+a +b}}{2}+\frac {\sqrt {b}\, \ln \left (\frac {b \left (\cot \left (x \right )^{2}+1\right )-b}{\sqrt {b}}+\sqrt {b \left (\cot \left (x \right )^{2}+1\right )^{2}-2 b \left (\cot \left (x \right )^{2}+1\right )+a +b}\right )}{2}+\frac {\sqrt {a +b}\, \ln \left (\frac {2 a +2 b -2 b \left (\cot \left (x \right )^{2}+1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\cot \left (x \right )^{2}+1\right )^{2}-2 b \left (\cot \left (x \right )^{2}+1\right )+a +b}}{\cot \left (x \right )^{2}+1}\right )}{2}\) \(139\)
default \(-\frac {\sqrt {b \left (\cot \left (x \right )^{2}+1\right )^{2}-2 b \left (\cot \left (x \right )^{2}+1\right )+a +b}}{2}+\frac {\sqrt {b}\, \ln \left (\frac {b \left (\cot \left (x \right )^{2}+1\right )-b}{\sqrt {b}}+\sqrt {b \left (\cot \left (x \right )^{2}+1\right )^{2}-2 b \left (\cot \left (x \right )^{2}+1\right )+a +b}\right )}{2}+\frac {\sqrt {a +b}\, \ln \left (\frac {2 a +2 b -2 b \left (\cot \left (x \right )^{2}+1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\cot \left (x \right )^{2}+1\right )^{2}-2 b \left (\cot \left (x \right )^{2}+1\right )+a +b}}{\cot \left (x \right )^{2}+1}\right )}{2}\) \(139\)

[In]

int(cot(x)*(a+b*cot(x)^4)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*(b*(cot(x)^2+1)^2-2*b*(cot(x)^2+1)+a+b)^(1/2)+1/2*b^(1/2)*ln((b*(cot(x)^2+1)-b)/b^(1/2)+(b*(cot(x)^2+1)^2
-2*b*(cot(x)^2+1)+a+b)^(1/2))+1/2*(a+b)^(1/2)*ln((2*a+2*b-2*b*(cot(x)^2+1)+2*(a+b)^(1/2)*(b*(cot(x)^2+1)^2-2*b
*(cot(x)^2+1)+a+b)^(1/2))/(cot(x)^2+1))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 252 vs. \(2 (72) = 144\).

Time = 0.45 (sec) , antiderivative size = 1063, normalized size of antiderivative = 11.81 \[ \int \cot (x) \sqrt {a+b \cot ^4(x)} \, dx=\text {Too large to display} \]

[In]

integrate(cot(x)*(a+b*cot(x)^4)^(1/2),x, algorithm="fricas")

[Out]

[1/4*sqrt(a + b)*log(1/2*(a^2 + 2*a*b + b^2)*cos(2*x)^2 + 1/2*a^2 + 1/2*b^2 + 1/2*((a + b)*cos(2*x)^2 - 2*a*co
s(2*x) + a - b)*sqrt(a + b)*sqrt(((a + b)*cos(2*x)^2 - 2*(a - b)*cos(2*x) + a + b)/(cos(2*x)^2 - 2*cos(2*x) +
1)) - (a^2 - b^2)*cos(2*x)) + 1/4*sqrt(b)*log(-((a + 2*b)*cos(2*x)^2 - 2*(cos(2*x)^2 - 1)*sqrt(b)*sqrt(((a + b
)*cos(2*x)^2 - 2*(a - b)*cos(2*x) + a + b)/(cos(2*x)^2 - 2*cos(2*x) + 1)) - 2*(a - 2*b)*cos(2*x) + a + 2*b)/(c
os(2*x)^2 - 2*cos(2*x) + 1)) - 1/2*sqrt(((a + b)*cos(2*x)^2 - 2*(a - b)*cos(2*x) + a + b)/(cos(2*x)^2 - 2*cos(
2*x) + 1)), 1/2*sqrt(-b)*arctan(sqrt(-b)*sqrt(((a + b)*cos(2*x)^2 - 2*(a - b)*cos(2*x) + a + b)/(cos(2*x)^2 -
2*cos(2*x) + 1))*(cos(2*x) - 1)/(b*cos(2*x) + b)) + 1/4*sqrt(a + b)*log(1/2*(a^2 + 2*a*b + b^2)*cos(2*x)^2 + 1
/2*a^2 + 1/2*b^2 + 1/2*((a + b)*cos(2*x)^2 - 2*a*cos(2*x) + a - b)*sqrt(a + b)*sqrt(((a + b)*cos(2*x)^2 - 2*(a
 - b)*cos(2*x) + a + b)/(cos(2*x)^2 - 2*cos(2*x) + 1)) - (a^2 - b^2)*cos(2*x)) - 1/2*sqrt(((a + b)*cos(2*x)^2
- 2*(a - b)*cos(2*x) + a + b)/(cos(2*x)^2 - 2*cos(2*x) + 1)), -1/2*sqrt(-a - b)*arctan(((a + b)*cos(2*x)^2 - 2
*a*cos(2*x) + a - b)*sqrt(-a - b)*sqrt(((a + b)*cos(2*x)^2 - 2*(a - b)*cos(2*x) + a + b)/(cos(2*x)^2 - 2*cos(2
*x) + 1))/((a^2 + 2*a*b + b^2)*cos(2*x)^2 + a^2 + 2*a*b + b^2 - 2*(a^2 - b^2)*cos(2*x))) + 1/4*sqrt(b)*log(-((
a + 2*b)*cos(2*x)^2 - 2*(cos(2*x)^2 - 1)*sqrt(b)*sqrt(((a + b)*cos(2*x)^2 - 2*(a - b)*cos(2*x) + a + b)/(cos(2
*x)^2 - 2*cos(2*x) + 1)) - 2*(a - 2*b)*cos(2*x) + a + 2*b)/(cos(2*x)^2 - 2*cos(2*x) + 1)) - 1/2*sqrt(((a + b)*
cos(2*x)^2 - 2*(a - b)*cos(2*x) + a + b)/(cos(2*x)^2 - 2*cos(2*x) + 1)), -1/2*sqrt(-a - b)*arctan(((a + b)*cos
(2*x)^2 - 2*a*cos(2*x) + a - b)*sqrt(-a - b)*sqrt(((a + b)*cos(2*x)^2 - 2*(a - b)*cos(2*x) + a + b)/(cos(2*x)^
2 - 2*cos(2*x) + 1))/((a^2 + 2*a*b + b^2)*cos(2*x)^2 + a^2 + 2*a*b + b^2 - 2*(a^2 - b^2)*cos(2*x))) + 1/2*sqrt
(-b)*arctan(sqrt(-b)*sqrt(((a + b)*cos(2*x)^2 - 2*(a - b)*cos(2*x) + a + b)/(cos(2*x)^2 - 2*cos(2*x) + 1))*(co
s(2*x) - 1)/(b*cos(2*x) + b)) - 1/2*sqrt(((a + b)*cos(2*x)^2 - 2*(a - b)*cos(2*x) + a + b)/(cos(2*x)^2 - 2*cos
(2*x) + 1))]

Sympy [F]

\[ \int \cot (x) \sqrt {a+b \cot ^4(x)} \, dx=\int \sqrt {a + b \cot ^{4}{\left (x \right )}} \cot {\left (x \right )}\, dx \]

[In]

integrate(cot(x)*(a+b*cot(x)**4)**(1/2),x)

[Out]

Integral(sqrt(a + b*cot(x)**4)*cot(x), x)

Maxima [F]

\[ \int \cot (x) \sqrt {a+b \cot ^4(x)} \, dx=\int { \sqrt {b \cot \left (x\right )^{4} + a} \cot \left (x\right ) \,d x } \]

[In]

integrate(cot(x)*(a+b*cot(x)^4)^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(b*cot(x)^4 + a)*cot(x), x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 204 vs. \(2 (72) = 144\).

Time = 0.30 (sec) , antiderivative size = 204, normalized size of antiderivative = 2.27 \[ \int \cot (x) \sqrt {a+b \cot ^4(x)} \, dx=-\frac {b \arctan \left (-\frac {\sqrt {a + b} \sin \left (x\right )^{2} - \sqrt {a \sin \left (x\right )^{4} + b \sin \left (x\right )^{4} - 2 \, b \sin \left (x\right )^{2} + b}}{\sqrt {-b}}\right )}{\sqrt {-b}} - \frac {1}{2} \, \sqrt {a + b} \log \left ({\left | -{\left (\sqrt {a + b} \sin \left (x\right )^{2} - \sqrt {a \sin \left (x\right )^{4} + b \sin \left (x\right )^{4} - 2 \, b \sin \left (x\right )^{2} + b}\right )} {\left (a + b\right )} + \sqrt {a + b} b \right |}\right ) - \frac {{\left (\sqrt {a + b} \sin \left (x\right )^{2} - \sqrt {a \sin \left (x\right )^{4} + b \sin \left (x\right )^{4} - 2 \, b \sin \left (x\right )^{2} + b}\right )} b - \sqrt {a + b} b}{{\left (\sqrt {a + b} \sin \left (x\right )^{2} - \sqrt {a \sin \left (x\right )^{4} + b \sin \left (x\right )^{4} - 2 \, b \sin \left (x\right )^{2} + b}\right )}^{2} - b} \]

[In]

integrate(cot(x)*(a+b*cot(x)^4)^(1/2),x, algorithm="giac")

[Out]

-b*arctan(-(sqrt(a + b)*sin(x)^2 - sqrt(a*sin(x)^4 + b*sin(x)^4 - 2*b*sin(x)^2 + b))/sqrt(-b))/sqrt(-b) - 1/2*
sqrt(a + b)*log(abs(-(sqrt(a + b)*sin(x)^2 - sqrt(a*sin(x)^4 + b*sin(x)^4 - 2*b*sin(x)^2 + b))*(a + b) + sqrt(
a + b)*b)) - ((sqrt(a + b)*sin(x)^2 - sqrt(a*sin(x)^4 + b*sin(x)^4 - 2*b*sin(x)^2 + b))*b - sqrt(a + b)*b)/((s
qrt(a + b)*sin(x)^2 - sqrt(a*sin(x)^4 + b*sin(x)^4 - 2*b*sin(x)^2 + b))^2 - b)

Mupad [F(-1)]

Timed out. \[ \int \cot (x) \sqrt {a+b \cot ^4(x)} \, dx=\int \mathrm {cot}\left (x\right )\,\sqrt {b\,{\mathrm {cot}\left (x\right )}^4+a} \,d x \]

[In]

int(cot(x)*(a + b*cot(x)^4)^(1/2),x)

[Out]

int(cot(x)*(a + b*cot(x)^4)^(1/2), x)